#include "gtest\gtest.h"
#include "base_object.h"

namespace nsbase = nsshare::base;

namespace
{

TEST(BaseObjectTest, CopyAndAssign)
{
    static const char * tag = "helloworld";
    nsbase::BaseObject foo(tag);
    nsbase::BaseObject bar = nsbase::BaseObject(foo);
}

class RefCountFoo : public nsbase::RefCountObject
{
};

TEST(RefCountObjectTest, RefUpDown)
{
    RefCountFoo foo;
    EXPECT_EQ(2, foo.IncRef());
    EXPECT_EQ(1, foo.DecRef());
}

}